<template>
	<view class="collected">
		<view class="list" v-if="this.list.length != 0">
			<view class="item" v-for="item in list" :key="item.id" @tap="goDetail(item.id)">
				<image class="img" :src="item.pic"></image>
				<view class="info">
					<view class="name">{{ item.name }}</view>
					<view class="text">
						<view class="collect">收藏</view>
						<view class="price">￥{{ item.price }}</view>
					</view>
				</view>
			</view>
		</view>
		<view class="none" v-else>
			暂无数据
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [], // 收藏列表
			};
		},
		onLoad() {
			this.list = uni.getStorageSync("collectedLsit")
		},
		methods:{
			goDetail(val){
				// 跳转 - 商品详情页
				uni.navigateTo({
					url: `../../kind/goods/detail/detail?id=${val}`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
@import './index.scss'
</style>
